home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / p_man / cat3 / SCSL / ccfft.z / ccfft
Encoding:
Text File  |  2002-10-03  |  26.0 KB  |  595 lines

  1.  
  2.  
  3.  
  4. CCCCCCCCFFFFFFFFTTTT((((3333SSSS))))                                                            CCCCCCCCFFFFFFFFTTTT((((3333SSSS))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      CCCCCCCCFFFFFFFFTTTT, ZZZZZZZZFFFFFFFFTTTT - Applies a complex-to-complex Fast Fourier Transform (FFT)
  10.  
  11. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.      Single precision complex -> Single precision complex
  13.  
  14.           Fortran:
  15.                CCCCAAAALLLLLLLL CCCCCCCCFFFFFFFFTTTT ((((_i_s_i_g_n,,,, _n,,,, _s_c_a_l_e,,,, _x,,,, _y,,,, _t_a_b_l_e,,,, _w_o_r_k,,,, _i_s_y_s))))
  16.  
  17.           C/C++:
  18.                ####iiiinnnncccclllluuuuddddeeee <<<<ssssccccssssllll____fffffffftttt....hhhh>>>>
  19.                iiiinnnntttt ccccccccfffffffftttt ((((iiiinnnntttt _i_s_i_g_n,,,, iiiinnnntttt _n,,,, ffffllllooooaaaatttt _s_c_a_l_e,,,, ssssccccssssllll____ccccoooommmmpppplllleeeexxxx *_x,,,,
  20.                ssssccccssssllll____ccccoooommmmpppplllleeeexxxx *_y,,,, ffffllllooooaaaatttt *_t_a_b_l_e,,,, ffffllllooooaaaatttt *_w_o_r_k,,,, iiiinnnntttt *_i_s_y_s))));;;;
  21.  
  22.           C++ STL:
  23.                ####iiiinnnncccclllluuuuddddeeee <<<<ccccoooommmmpppplllleeeexxxx....hhhh>>>>
  24.                ####iiiinnnncccclllluuuuddddeeee <<<<ssssccccssssllll____fffffffftttt....hhhh>>>>
  25.                iiiinnnntttt ccccccccfffffffftttt ((((iiiinnnntttt _i_s_i_g_n,,,, iiiinnnntttt _n,,,, ffffllllooooaaaatttt _s_c_a_l_e,,,, ccccoooommmmpppplllleeeexxxx<<<<ffffllllooooaaaatttt>>>> *_x,,,,
  26.                ccccoooommmmpppplllleeeexxxx<<<<ffffllllooooaaaatttt>>>> *_y,,,, ffffllllooooaaaatttt *_t_a_b_l_e,,,, ffffllllooooaaaatttt *_w_o_r_k,,,, iiiinnnntttt *_i_s_y_s))));;;;
  27.  
  28.      Double precision complex -> Double precision complex
  29.  
  30.           Fortran:
  31.                CCCCAAAALLLLLLLL ZZZZZZZZFFFFFFFFTTTT ((((_i_s_i_g_n,,,, _n,,,, _s_c_a_l_e,,,, _x,,,, _y,,,, _t_a_b_l_e,,,, _w_o_r_k,,,, _i_s_y_s))))
  32.  
  33.           C/C++:
  34.                ####iiiinnnncccclllluuuuddddeeee <<<<ssssccccssssllll____fffffffftttt....hhhh>>>>
  35.                iiiinnnntttt zzzzzzzzfffffffftttt ((((iiiinnnntttt _i_s_i_g_n,,,, iiiinnnntttt _n,,,, ddddoooouuuubbbblllleeee _s_c_a_l_e,,,, ssssccccssssllll____zzzzoooommmmpppplllleeeexxxx *_x,,,,
  36.                ssssccccssssllll____zzzzoooommmmpppplllleeeexxxx *_y,,,, ddddoooouuuubbbblllleeee *_t_a_b_l_e,,,, ddddoooouuuubbbblllleeee *_w_o_r_k,,,, iiiinnnntttt *_i_s_y_s))));;;;
  37.  
  38.           C++ STL:
  39.                ####iiiinnnncccclllluuuuddddeeee <<<<ccccoooommmmpppplllleeeexxxx....hhhh>>>>
  40.                ####iiiinnnncccclllluuuuddddeeee <<<<ssssccccssssllll____fffffffftttt....hhhh>>>>
  41.                iiiinnnntttt zzzzzzzzfffffffftttt ((((iiiinnnntttt _i_s_i_g_n,,,, iiiinnnntttt _n,,,, ddddoooouuuubbbblllleeee _s_c_a_l_e,,,, ccccoooommmmpppplllleeeexxxx<<<<ddddoooouuuubbbblllleeee>>>> *_x,,,,
  42.                ccccoooommmmpppplllleeeexxxx<<<<ddddoooouuuubbbblllleeee>>>> *_y,,,, ddddoooouuuubbbblllleeee *_t_a_b_l_e,,,, ddddoooouuuubbbblllleeee *_w_o_r_k,,,, iiiinnnntttt *_i_s_y_s))));;;;
  43.  
  44. IIIIMMMMPPPPLLLLEEEEMMMMEEEENNNNTTTTAAAATTTTIIIIOOOONNNN
  45.      These routines are part of the SCSL Scientific Library and can be loaded
  46.      using either the ----llllssssccccssss or the ----llllssssccccssss____mmmmpppp option.  The ----llllssssccccssss____mmmmpppp option
  47.      directs the linker to use the multi-processor version of the library.
  48.  
  49.      When linking to SCSL with ----llllssssccccssss or ----llllssssccccssss____mmmmpppp, the default integer size is
  50.      4 bytes (32 bits). Another version of SCSL is available in which integers
  51.      are 8 bytes (64 bits).  This version allows the user access to larger
  52.      memory sizes and helps when porting legacy Cray codes.  It can be loaded
  53.      by using the ----llllssssccccssss____iiii8888 option or the ----llllssssccccssss____iiii8888____mmmmpppp option. A program may use
  54.      only one of the two versions; 4-byte integer and 8-byte integer library
  55.      calls cannot be mixed.
  56.  
  57.      The C and C++ prototypes shown above are appropriate for the 4-byte
  58.      integer version of SCSL. When using the 8-byte integer version, the
  59.      variables of type iiiinnnntttt become lllloooonnnngggg lllloooonnnngggg and the <<<<ssssccccssssllll____fffffffftttt____iiii8888....hhhh>>>> header
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. CCCCCCCCFFFFFFFFTTTT((((3333SSSS))))                                                            CCCCCCCCFFFFFFFFTTTT((((3333SSSS))))
  71.  
  72.  
  73.  
  74.      file should be included.
  75.  
  76. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  77.      These routines compute the Fast Fourier Transform (FFT) of the complex
  78.      vector _x, and store the result in vector _y.
  79.  
  80.      In FFT applications, it is customary to use zero-based subscripts; the
  81.      formulas are simpler that way.  Suppose that the arrays are declared as
  82.      follows:
  83.  
  84.           Fortran:
  85.  
  86.                COMPLEX X(0:N-1), Y(0:N-1)
  87.  
  88.  
  89.           C/C++:
  90.  
  91.                scsl_complex x[n], y[n];
  92.  
  93.  
  94.           C++ STL:
  95.  
  96.                complex<float> x[n], y[n];
  97.  
  98.  
  99.      The output array is the FFT of the input array, using the following
  100.      formula for the FFT:
  101.  
  102.  
  103.  
  104.                   n-1              isign * j * k
  105.           Y k  = scale * Sum [X * w              ]
  106.            k      j=0          j
  107.  
  108.  
  109.      for _k = 0 ..., _n-1 where:
  110.  
  111.      _w         = exp(2*_p_i*_i/_n),
  112.  
  113.      _i         = + sqrt(-1),
  114.  
  115.      _p_i        = 3.14159...
  116.  
  117.      _i_s_i_g_n     = +1 or -1
  118.  
  119.      Different authors use different conventions for which of the transforms,
  120.      _i_s_i_g_n = +1 or _i_s_i_g_n = -1, is the forward or inverse transform, and what
  121.      the scale factor should be in either case.  You can make this routine
  122.      compute any of the various possible definitions, however, by choosing the
  123.      appropriate values for _i_s_i_g_n and _s_c_a_l_e.
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. CCCCCCCCFFFFFFFFTTTT((((3333SSSS))))                                                            CCCCCCCCFFFFFFFFTTTT((((3333SSSS))))
  137.  
  138.  
  139.  
  140.      The relevant fact from FFT theory is this:  If you take the FFT with any
  141.      particular values of _i_s_i_g_n and _s_c_a_l_e, the mathematical inverse function
  142.      is computed by taking the FFT with -_i_s_i_g_n and nnnn 1111////((((_n*_s_c_a_l_e).  In
  143.      particular, if you use _i_s_i_g_n = +1 and _s_c_a_l_e = 1.0 you can compute the
  144.      inverse FFT by using _i_s_i_g_n = -1 and _s_c_a_l_e = 1.0/_n.
  145.  
  146.      The output array may be the same as the input array.
  147.  
  148.      See the NOTES section of this man page for information about the
  149.      interpretation of the data types described in the following arguments.
  150.  
  151.      These routines have the following arguments:
  152.  
  153.      _i_s_i_g_n     Integer.  (input)
  154.                Specifies whether to initialize the table array or to do the
  155.                forward or inverse Fourier transform, as follows:
  156.  
  157.                If _i_s_i_g_n = 0, the routine initializes the _t_a_b_l_e array and
  158.                returns.  In this case, the only arguments used or checked are
  159.                _i_s_i_g_n, _n, and _t_a_b_l_e.
  160.  
  161.                If _i_s_i_g_n = +1 or -1, the value of _i_s_i_g_n is the sign of the
  162.                exponent used in the FFT formula.
  163.  
  164.      _n         Integer.  (input)
  165.                Size of the transform (the number of values in the input
  166.                array).  _n >= 0.
  167.  
  168.      _s_c_a_l_e     Scale factor. (input).
  169.                CCCCCCCCFFFFFFFFTTTT: Single precision.
  170.                ZZZZZZZZFFFFFFFFTTTT: Double precision.
  171.                Each element of the output array is multiplied by _s_c_a_l_e after
  172.                taking the Fourier transform, as defined by the previous
  173.                formula.
  174.  
  175.      _x         Array of size _n.   (input)
  176.                CCCCCCCCFFFFFFFFTTTT: Single precision complex array.
  177.                ZZZZZZZZFFFFFFFFTTTT: Double precision complex array.
  178.  
  179.                Input array of values to be transformed.
  180.  
  181.      _y         Array of size _n.  (output)
  182.                CCCCCCCCFFFFFFFFTTTT: Single precision complex array.
  183.                ZZZZZZZZFFFFFFFFTTTT: Double precision complex array.
  184.                Output array of transformed values.  The output array may be
  185.                the same as the input array.  In that case, the transform is
  186.                done in place and the input array is overwritten with the
  187.                transformed values.
  188.  
  189.      _t_a_b_l_e     Array of size (2*_n + _N_F) (input or output)
  190.                CCCCCCCCFFFFFFFFTTTT: Single precision array.
  191.                ZZZZZZZZFFFFFFFFTTTT: Double precision array.
  192.  
  193.  
  194.  
  195.                                                                         PPPPaaaaggggeeee 3333
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202. CCCCCCCCFFFFFFFFTTTT((((3333SSSS))))                                                            CCCCCCCCFFFFFFFFTTTT((((3333SSSS))))
  203.  
  204.  
  205.  
  206.                Table of factors and roots of unity.  See the description of
  207.                the _i_s_y_s argument for the value of _N_F.
  208.  
  209.                If _i_s_i_g_n = 0, the routine initializes _t_a_b_l_e (_t_a_b_l_e is output
  210.                only).
  211.  
  212.                If _i_s_i_g_n = +1 or -1, the values in _t_a_b_l_e are assumed to be
  213.                initialized already by a prior call with _i_s_i_g_n = 0 (_t_a_b_l_e is
  214.                input only).
  215.  
  216.      _w_o_r_k      Array of size (2 * _n).
  217.                CCCCCCCCFFFFFFFFTTTT: Single precision array.
  218.                ZZZZZZZZFFFFFFFFTTTT: Double precision array.
  219.  
  220.                Work array.  This is a scratch array used for intermediate
  221.                calculations.  Its address space must be different address
  222.                space from that of the input and output arrays.
  223.  
  224.      _i_s_y_s      Integer array dimensioned 0000........_i_s_y_s((((0000))))
  225.                An array that gives implementation-specific information.  All
  226.                features and functions of the FFT routines specific to any
  227.                particular implementation are confined to this _i_s_y_s array.
  228.  
  229.                In the Origin series implementation, _i_s_y_s((((0000))))====0000 and _i_s_y_s((((0000))))====1111
  230.                are supported.  In SCSL versions prior to 1.3, only _i_s_y_s((((0000))))====0000
  231.                was allowed. For _i_s_y_s((((0000))))====0000, _N_F====33330000, and for _i_s_y_s((((0000))))====1111, _N_F====222255556666.
  232.                The _N_F words of storage in the _t_a_b_l_e array contain a
  233.                factorization of the length of the transform.
  234.  
  235.                The smaller value of _N_F for _i_s_y_s((((0000))))====0000 is historical. It is too
  236.                small to store all the required factors for the highest
  237.                performing FFT, so when _i_s_y_s((((0000))))====0000, extra space is allocated
  238.                when the _t_a_b_l_e array is initialized. To avoid memory leaks,
  239.                this extra space must be deallocated when the _t_a_b_l_e array is no
  240.                longer needed. The CCCCCCCCFFFFFFFFTTTTFFFF routine is used to release this
  241.                memory. Due to the potential for memory leaks, the use of
  242.                _i_s_y_s((((0000))))====0000 should be avoided.
  243.  
  244.                For _i_s_y_s((((0000))))====1111, the value of _N_F is large enough so that no extra
  245.                memory needs to be allocated, and there is no need to call
  246.                CCCCCCCCFFFFFFFFTTTTFFFF to release memory. If called, it does nothing.
  247.  
  248.                NOTE: _i_s_y_s((((0000))))====1111 means that _i_s_y_s is an integer array with two
  249.                elements. The second element, _i_s_y_s((((1111)))), will not be accessed.
  250.  
  251. NNNNOOOOTTTTEEEESSSS
  252.      The following data types are described in this documentation:
  253.  
  254.           TTTTeeeerrrrmmmm UUUUsssseeeedddd                     DDDDaaaattttaaaa ttttyyyyppppeeee
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.                                                                         PPPPaaaaggggeeee 4444
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268. CCCCCCCCFFFFFFFFTTTT((((3333SSSS))))                                                            CCCCCCCCFFFFFFFFTTTT((((3333SSSS))))
  269.  
  270.  
  271.  
  272.      Fortran:
  273.  
  274.           Array dimensioned _n           xxxx((((nnnn))))
  275.  
  276.           Array of dimensions (_m,_n)     xxxx((((mmmm,,,,nnnn))))
  277.  
  278.           Integer                       IIIINNNNTTTTEEEEGGGGEEEERRRR (IIIINNNNTTTTEEEEGGGGEEEERRRR****8888 for ----llllssssccccssss____iiii8888[[[[____mmmmpppp]]]])
  279.  
  280.           Single precision              RRRREEEEAAAALLLL
  281.  
  282.           Double precision              DDDDOOOOUUUUBBBBLLLLEEEE PPPPRRRREEEECCCCIIIISSSSIIIIOOOONNNN
  283.  
  284.           Single precision complex      CCCCOOOOMMMMPPPPLLLLEEEEXXXX
  285.  
  286.           Double precision complex      DDDDOOOOUUUUBBBBLLLLEEEE CCCCOOOOMMMMPPPPLLLLEEEEXXXX
  287.  
  288.      C/C++:
  289.  
  290.           Array dimensioned _n           xxxx[[[[_n]]]]
  291.  
  292.           Array of dimensions (_m,_n)     xxxx[[[[mmmm****nnnn]]]] oooorrrr xxxx[[[[nnnn]]]][[[[mmmm]]]]
  293.  
  294.           Integer                       iiiinnnntttt (lllloooonnnngggg lllloooonnnngggg for ----llllssssccccssss____iiii8888[[[[____mmmmpppp]]]])
  295.  
  296.           Single precision              ffffllllooooaaaatttt
  297.  
  298.           Double precision              ddddoooouuuubbbblllleeee
  299.  
  300.           Single precision complex      ssssccccssssllll____ccccoooommmmpppplllleeeexxxx
  301.  
  302.           Double precision complex      ssssccccssssllll____zzzzoooommmmpppplllleeeexxxx
  303.  
  304.      C++ STL:
  305.  
  306.           Array dimensioned _n           xxxx[[[[_n]]]]
  307.  
  308.           Array of dimensions (_m,_n)     xxxx[[[[mmmm****nnnn]]]] oooorrrr xxxx[[[[nnnn]]]][[[[mmmm]]]]
  309.  
  310.           Integer                       iiiinnnntttt (lllloooonnnngggg lllloooonnnngggg for ----llllssssccccssss____iiii8888[[[[____mmmmpppp]]]])
  311.  
  312.           Single precision              ffffllllooooaaaatttt
  313.  
  314.           Double precision              ddddoooouuuubbbblllleeee
  315.  
  316.           Single precision complex      ccccoooommmmpppplllleeeexxxx<<<<ffffllllooooaaaatttt>>>>
  317.  
  318.           Double precision complex      ccccoooommmmpppplllleeeexxxx<<<<ddddoooouuuubbbblllleeee>>>>
  319.  
  320. CCCCAAAAUUUUTTTTIIIIOOOONNNNSSSS
  321.      Transform sizes with a prime factor exceeding 22223332222----1111 are not supported for
  322.      the 8-byte integer version of the library.
  323.  
  324.  
  325.  
  326.  
  327.                                                                         PPPPaaaaggggeeee 5555
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334. CCCCCCCCFFFFFFFFTTTT((((3333SSSS))))                                                            CCCCCCCCFFFFFFFFTTTT((((3333SSSS))))
  335.  
  336.  
  337.  
  338.      In addition to the _w_o_r_k array, the FFT routines also dynamically allocate
  339.      scratch space from the stack. The amount of space allocated can be
  340.      slightly bigger than the size of the largest processor cache. For single
  341.      processor runs, the default stack size is large enough that these
  342.      allocations generally cause no problems. But for parallel runs, you need
  343.      to ensure that the stack size of slave threads is big enough to hold this
  344.      scratch space. Failure to reserve sufficient stack space will cause
  345.      programs to dump core due to stack overflows.  The stack size of MP
  346.      library slave threads is controlled via the MMMMPPPP____SSSSLLLLAAAAVVVVEEEE____SSSSTTTTAAAACCCCKKKKSSSSIIIIZZZZEEEE
  347.      environment variable or the mmmmpppp____sssseeeetttt____ssssllllaaaavvvveeee____ssssttttaaaacccckkkkssssiiiizzzzeeee(((()))) library routine. See
  348.      the mmmmpppp(3C), mmmmpppp(3F) and ppppeeee____eeeennnnvvvviiiirrrroooonnnn(5) reference pages for more information
  349.      on controlling the slave stack size. For pthreads applications, the
  350.      thread's stack size is specified as one of many creation attributes
  351.      provided in the pthread_attr_t argument to pppptttthhhhrrrreeeeaaaadddd____ccccrrrreeeeaaaatttteeee(3P).  The
  352.      stacksize attribute should be set explicitly to a non-default value using
  353.      the pppptttthhhhrrrreeeeaaaadddd____aaaattttttttrrrr____sssseeeettttssssttttaaaacccckkkkssssiiiizzzzeeee(3P) call, described in the
  354.      pppptttthhhhrrrreeeeaaaadddd____aaaattttttttrrrr____iiiinnnniiiitttt(3P) man page.
  355.  
  356.      Care must be exercised if copies of the _t_a_b_l_e array are used: even though
  357.      a copy exists, the original must persist. As an example, the following
  358.      code will nnnnooootttt work:
  359.  
  360.           #include <scsl_fft.h>
  361.           scsl_complex x[1024], y[1024];
  362.           float table[2048+256];
  363.           float work[2048];
  364.           int isys[2];
  365.           isys[0] = 1;
  366.           {
  367.             float table_orig[2048+256];
  368.  
  369.             ccfft(0, 1024, 1.0f, x, y, table_orig, work, isys);
  370.             bcopy(table_orig, table, (2048+256)*sizeof(float));
  371.           }
  372.           ccfft(1, 1024, 1.0f, x, y, table, work, isys);
  373.  
  374.  
  375.      In this example, because _t_a_b_l_e__o_r_i_g is a stack variable that does not
  376.      persist outside of the code block delimited by the braces, the data in
  377.      the copy, _t_a_b_l_e, are not guaranteed to be valid. However, the following
  378.      code will work because _t_a_b_l_e__o_r_i_g is persistent:
  379.  
  380.           #include <scsl_fft.h>
  381.           scsl_complex x[1024], y[1024];
  382.           float table_orig[2048+256], table[2048+256];
  383.           float work[2048];
  384.           int isys[2];
  385.           isys[0] = 1;
  386.           ccfft(0, 1024, 1.0f, x, y, table_orig, work, isys);
  387.           bcopy(table_orig, table, (2048+256)*sizeof(float));
  388.           ccfft(1, 1024, 1.0f, x, y, table, work, isys);
  389.  
  390.  
  391.  
  392.  
  393.                                                                         PPPPaaaaggggeeee 6666
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400. CCCCCCCCFFFFFFFFTTTT((((3333SSSS))))                                                            CCCCCCCCFFFFFFFFTTTT((((3333SSSS))))
  401.  
  402.  
  403.  
  404. EEEEXXXXAAAAMMMMPPPPLLLLEEEESSSS
  405.      These examples use the table and workspace sizes appropriate to the
  406.      Origin series.
  407.  
  408.      Example 1:  Initialize the _t_a_b_l_e array in preparation for doing an FFT of
  409.      size 1024.  Only the _i_s_i_g_n, _n, and _t_a_b_l_e arguments are used in this case.
  410.      You can use dummy arguments or zeros for the other arguments in the
  411.      subroutine call.
  412.  
  413.      Fortran:
  414.  
  415.           REAL TABLE(2048+256)
  416.           INTEGER ISYS(0:1)
  417.           ISYS(0) = 1
  418.           CALL CCFFT(0, 1024, 0.0, DUMMY, DUMMY, TABLE, DUMMY, ISYS)
  419.  
  420.  
  421.      C/C++:
  422.  
  423.           #include <scsl_fft.h>
  424.           float table[2048+256];
  425.           int isys[2];
  426.           isys[0] = 1;
  427.           ccfft(0, 1024, 0.0f, NULL, NULL, table, NULL, isys);
  428.  
  429.  
  430.      C++ STL:
  431.  
  432.      #include <complex.h>
  433.      #include <scsl_fft.h>
  434.      float table[2048+256];
  435.      int isys[2];
  436.      isys[0] = 1;
  437.      ccfft(0, 1024, 0.0f, NULL, NULL, table, NULL, isys);
  438.  
  439.  
  440.      Example 2:  _x and _y are complex arrays of dimension (0:1023).  Take the
  441.      FFT of _x and store the results in _y.  Before taking the FFT, initialize
  442.      the _t_a_b_l_e array, as in example 1.
  443.  
  444.      Fortran:
  445.  
  446.           COMPLEX X(0:1023), Y(0:1023)
  447.           REAL TABLE(2048+256)
  448.           REAL WORK(2048)
  449.           INTEGER ISYS(0:1)
  450.           ISYS(0) = 1
  451.           CALL CCFFT(0, 1024, 1.0, X, Y, TABLE, WORK, ISYS)
  452.           CALL CCFFT(1, 1024, 1.0, X, Y, TABLE, WORK, ISYS)
  453.  
  454.  
  455.  
  456.  
  457.  
  458.  
  459.                                                                         PPPPaaaaggggeeee 7777
  460.  
  461.  
  462.  
  463.  
  464.  
  465.  
  466. CCCCCCCCFFFFFFFFTTTT((((3333SSSS))))                                                            CCCCCCCCFFFFFFFFTTTT((((3333SSSS))))
  467.  
  468.  
  469.  
  470.      C/C++:
  471.  
  472.           #include <scsl_fft.h>
  473.           scsl_complex x[1024], y[1024];
  474.           float table[2048+256];
  475.           float work[2048];
  476.           int isys[2];
  477.           isys[0] = 1;
  478.           ccfft(0, 1024, 1.0f, x, y, table, work, isys);
  479.           ccfft(1, 1024, 1.0f, x, y, table, work, isys);
  480.  
  481.  
  482.      C++ STL:
  483.  
  484.           #include <complex.h>
  485.           #include <scsl_fft.h>
  486.           complex<float> x[1024], y[1024];
  487.           float table[2048+256];
  488.           float work[2048];
  489.           int isys[2];
  490.           isys[0] = 1;
  491.           ccfft(0, 1024, 1.0f, x, y, table, work, isys);
  492.           ccfft(1, 1024, 1.0f, x, y, table, work, isys);
  493.  
  494.  
  495.      Example 3:  Using the same _x and _y as in example 2, take the inverse FFT
  496.      of _y and store it back in _x.  The scale factor 1/1024 is used.  Assume
  497.      that the _t_a_b_l_e array is already initialized.
  498.  
  499.      Fortran:
  500.  
  501.           CALL CCFFT(-1, 1024, 1.0/1024.0, Y, X, TABLE, WORK, ISYS)
  502.  
  503.  
  504.      C/C++ and C++ STL:
  505.  
  506.           ccfft(-1, 1024, 1.0f/1024.0f, y, x, table, work, isys);
  507.  
  508.  
  509.      Example 4:  Perform the same computation as in example 2, but put the
  510.      output back in array _x to save storage space. Use the 8-byte integer
  511.      version of SCSL.
  512.  
  513.      Fortran:
  514.  
  515.           COMPLEX X(0:1023)
  516.           REAL TABLE(2048+256)
  517.           REAL WORK(2048)
  518.           INTEGER*8 ISYS(0:1)
  519.           ISYS(0) = 1_8
  520.           CALL CCFFT(0_8, 1024_8, 1.0, X, X, TABLE, WORK, ISYS)
  521.           CALL CCFFT(1_8, 1024_8, 1.0, X, X, TABLE, WORK, ISYS)
  522.  
  523.  
  524.  
  525.                                                                         PPPPaaaaggggeeee 8888
  526.  
  527.  
  528.  
  529.  
  530.  
  531.  
  532. CCCCCCCCFFFFFFFFTTTT((((3333SSSS))))                                                            CCCCCCCCFFFFFFFFTTTT((((3333SSSS))))
  533.  
  534.  
  535.  
  536.      C/C++:
  537.  
  538.           #include <scsl_fft_i8.h>
  539.           scsl_complex x[1024]
  540.           float table[2048+256];
  541.           float work[2048];
  542.           long long isys[2];
  543.           isys[0] = 1LL;
  544.           ccfft(0LL, 1024LL, 1.0f, x, x, table, work, isys);
  545.           ccfft(1LL, 1024LL, 1.0f, x, x, table, work, isys);
  546.  
  547.  
  548.      C++ STL:
  549.  
  550.           #include <complex.h>
  551.           #include <scsl_fft_i8.h>
  552.           complex<float> x[1024]
  553.           float table[2048+256];
  554.           float work[2048];
  555.           long long isys[2];
  556.           isys[0] = 1LL;
  557.           ccfft(0LL, 1024LL, 1.0f, x, x, table, work, isys);
  558.           ccfft(1LL, 1024LL, 1.0f, x, x, table, work, isys);
  559.  
  560.  
  561.      Example 5:  Perform the same computation as in example 2, but assume that
  562.      the lower bound of each Fortran array is 1, rather than 0.  No change is
  563.      needed in the subroutine calls:
  564.  
  565.      Fortran:
  566.  
  567.           COMPLEX X(1024), Y(1024)
  568.           CALL CCFFT(0, 1024, 1.0, X, Y, TABLE, WORK, ISYS)
  569.           CALL CCFFT(1, 1024, 1.0, X, Y, TABLE, WORK, ISYS)
  570.  
  571.  
  572. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  573.      IIIINNNNTTTTRRRROOOO____FFFFFFFFTTTT(3S), IIIINNNNTTTTRRRROOOO____SSSSCCCCSSSSLLLL(3S), CCCCCCCCFFFFFFFFTTTTMMMM(3S), SSSSCCCCFFFFFFFFTTTT(3S), SSSSCCCCFFFFFFFFTTTTMMMM(3S)
  574.  
  575.  
  576.  
  577.  
  578.  
  579.  
  580.  
  581.  
  582.  
  583.  
  584.  
  585.  
  586.  
  587.  
  588.                                                                         PPPPaaaaggggeeee 9999
  589.  
  590.  
  591.  
  592.  
  593.  
  594.  
  595.